
// const { Sequelize, DataTypes } = require("sequelize");
const { STRING, INTEGER, LONGSTRING } = require('../types')

module.exports = (sequelize) => {
  const advice = sequelize.define(
    'advice',
    {// 在这里定义模型属性
      id: {
        type: INTEGER,
        primaryKey:true,
        autoIncrement:true,
        allowNull:false
      },
      userId: { // 用户
        type: STRING,
      },
      type: {type: STRING}, // 咨询还是建议
      username: {type: STRING},
      phone: {type: STRING},
      content: {type: LONGSTRING},
      state: {type: STRING},
    },
    {
    tableName: "advice",//直接提供表名
    timestamps: false
   }
  );
  return advice
}
